<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>属性传递</title>
</head>

<body>
  <script src="../../node_modules/vue/dist/vue.js"></script>
  <div id="app">
    <counter :count="count"></counter>
    <counter :count="count"></counter>
    <counter :count="count"></counter>
    <button @click="count++">increment</button>
  </div>
  <script>
    new Vue({
      el: '#app',
      data() {
        return {
          count: 0
        }
      },
      components: {
        counter: {
          props: ['count'],
          template: `<div>{{count}}</div>`
        }
      }
    })
  </script>
</body>

</html>